package edu.tec.mty.extras;

import java.util.Hashtable;

public class Tree<T> {
	
	private T t;
	private String name;
	private Hashtable<String, Tree> childs; 
	
	public Tree(String name) {
		this.name = name;
		this.childs = new Hashtable<String, Tree>();
	}
	
	public void setObject(T t) {
		this.t = t;
	}
	
	public String getName() {
		return this.name;
	}
	
	public T getObject() {
		return this.t;
	}
	
	public int getDepth() {
		return 0;
	}
	
	public void addChild(Tree tree) {
		this.childs.put(tree.getName(), tree);
	}
	
	public Hashtable<String, Tree> getChilds() {
		return this.childs;
	}

	/* Test */
	
	/*public static void main(String[] args) {
		Tree<Integer> tree = new Tree<Integer>("parent");
		Tree<String> treeS = new Tree<String>("child");
		tree.setObject(1);
		treeS.setObject("Hola");
		tree.addChild(treeS);
		String text = (String)tree.getChilds().get("child").getObject();
		System.out.println(text);
	}*/
	
}
